"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomMatchConfig = void 0;
const RoomModel_1 = require("../../hall_server/model/RoomModel");
const RoomConfig_1 = require("./RoomConfig");
class RoomMatchConfig {
    constructor(gameType, serve, renshu) {
        this.online = 0;
        this.gameType = gameType;
        this.serve = serve;
        this.renshu = renshu;
    }
    static init() {
        return __awaiter(this, void 0, void 0, function* () {
        });
    }
    static getConfigList() {
        for (let i = 0; i < this.configList.length; i++) {
            let config = this.configList[i];
            config.online = RoomModel_1.RoomModel.getRoomOnlineNumByRoomTypeAndGameType(RoomConfig_1.RoomConfig.Room_Type.Match, config.gameType);
        }
        return this.configList;
    }
    static getConfigByGame(gameType) {
        let configList = this.configList;
        for (let i = 0; i < configList.length; i++) {
            let config = configList[i];
            if (config.gameType == gameType) {
                return config;
            }
        }
    }
}
exports.RoomMatchConfig = RoomMatchConfig;
RoomMatchConfig.configList = [];
